'''
utils.py - Miscellaneous utility functions.

Author: Eric Saunders
October 2011
'''


def set_type_from_string(incoming_string):
    ''' Convert the provided string to the most appropriate datatype possible.'''

    for variable_type in (int, float, str):
        try:
            return variable_type(incoming_string)
        except ValueError:
            pass
